﻿@using MvcContrib.UI.Grid;
@using MvcContrib.Samples.UI.Models;
@model IEnumerable<Person>

@{
    ViewBag.Title = "Simple Grid Example";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@ViewBag.Title</h2>

@Html.Grid(Model).Columns(column => {
	column.For(x => x.Id).Named("Person ID");
	column.For(x => x.Name);
    column.For(x => x.Gender);
    column.For(x => x.DateOfBirth).Format("{0:d}");
	//The column containing the link is not automatically encoded because the grid is aware of helpers that return MvcHtmlString.
	column.For(x => Html.ActionLink("View Person", "Show", new { id = x.Id }));
})